package com.ruoyi.topicComplain.service.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.topicComplain.mapper.TopicComplainMapper;
import com.ruoyi.topicComplain.domain.TopicComplain;
import com.ruoyi.topicComplain.service.ITopicComplainService;
import com.ruoyi.common.core.text.Convert;

/**
 * 话题举报 服务层实现
 * 
 * @author ruoyi
 * @date 2019-10-14
 */
@Service
public class TopicComplainServiceImpl implements ITopicComplainService 
{
	@Autowired
	private TopicComplainMapper topicComplainMapper;

	/**
     * 查询话题举报信息
     * 
     * @param id 话题举报ID
     * @return 话题举报信息
     */
    @Override
	public TopicComplain selectTopicComplainById(Integer id)
	{
	    return topicComplainMapper.selectTopicComplainById(id);
	}
	
	/**
     * 查询话题举报列表
     * 
     * @param topicComplain 话题举报信息
     * @return 话题举报集合
     */
	@Override
	public List<TopicComplain> selectTopicComplainList(TopicComplain topicComplain)
	{
	    return topicComplainMapper.selectTopicComplainList(topicComplain);
	}
	
    /**
     * 新增话题举报
     * 
     * @param topicComplain 话题举报信息
     * @return 结果
     */
	@Override
	public int insertTopicComplain(TopicComplain topicComplain)
	{
	    return topicComplainMapper.insertTopicComplain(topicComplain);
	}
	
	/**
     * 修改话题举报
     * 
     * @param topicComplain 话题举报信息
     * @return 结果
     */
	@Override
	public int updateTopicComplain(TopicComplain topicComplain)
	{
	    return topicComplainMapper.updateTopicComplain(topicComplain);
	}

	/**
     * 删除话题举报对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteTopicComplainByIds(String ids)
	{
		return topicComplainMapper.deleteTopicComplainByIds(Convert.toStrArray(ids));
	}

	public int updateComplainVerify(@Param("complainVerify") Integer complainVerify, @Param("topicId") Integer topicId) {
		return topicComplainMapper.updateComplainVerify(complainVerify,topicId);
	};
	
}
